<template>
  <div v-if="flag" class="jeecg-update-tip-bar">
    <div class="container">
      <div class="outer">
        <div class="inner">
          <span class="tip">正在修改表单数据...</span>
          <div class="cancel" @click="($event) => $emit('cancel')">取消</div>
          <div class="cancel" @click="($event) => $emit('save')">保存</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script lang="ts">
  import { defineComponent, computed } from 'vue';

  export default defineComponent({
    name: 'JModalTip',
    props: {
      visible: {
        type: Boolean,
        default: false,
      },
    },
    emits: ['save', 'cancel'],
    setup(props) {
      const flag = computed(() => {
        return props.visible;
      });
      return {
        flag,
      };
    },
  });
</script>
<style scoped>
  .jeecg-update-tip-bar {
    width: calc(100%-100px);
    font-size: 14px;
  }
  .jeecg-update-tip-bar .container {
    position: relative;
    margin: 0 auto;
  }
  .jeecg-update-tip-bar .container .outer {
    position: absolute;
    display: flex;
    -webkit-box-align: center;
    align-items: center;
    -webkit-box-pack: center;
    justify-content: center;
    width: 100%;
    z-index: 11;
    top: -30px;
  }

  .jeecg-update-tip-bar .container .outer .inner {
    height: 42px;
    border-radius: 42px;
    color: #fff;
    background-color: #2196f3;
    line-height: 42px;
    z-index: 9;
    box-shadow: #0000001f 0 6px 24px 0 2px 4px;
    display: flex;
    flex-direction: row;
    -webkit-box-align: center;
    align-items: center;
    min-width: 380px;
    padding: 0 10px 0 24px;
  }

  .jeecg-update-tip-bar .container .outer .inner .tip {
    -webkit-flex: 1;
    flex: 1 1 0;
    -ms-flex: 1;
    font-weight: 700;
  }

  .jeecg-update-tip-bar .container .outer .inner .cancel {
    cursor: pointer;
    display: inline-block;
    height: 28px;
    line-height: 28px;
    border-radius: 28px;
    color: #fff;
    margin-left: 30px !important;
    margin-right: 10px !important;
    padding: 0 18px;
  }

  .jeecg-update-tip-bar .container .outer .inner .cancel:hover {
    background-color: #ffffff29;
  }

  .jeecg-update-tip-bar .container .outer .inner .save {
    cursor: pointer;
    display: inline-block;
    height: 28px;
    line-height: 28px;
    border-radius: 28px;
    color: #3ea4fc;
    background-color: #fff;
    font-weight: 600;
    padding: 0 18px;
  }

  .jeecg-update-tip-bar .container .outer .inner .save:hover {
    background-color: #e2f1fe;
  }
</style>
